package InterfazAdministrador;

import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.SQLException;
import java.util.ArrayList;

import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.ListSelectionModel;

public class VentanaListaEmpleados extends JDialog {

	public JList listaEmpleados;
	private ControlerAdministrador controlador;
	ArrayList<String> a;
	public VentanaListaEmpleados() throws SQLException {
	
		
		setLayout(null);
		setTitle("Muebles Polilla- Lista Empleados");
		getContentPane().setBackground( Color.white);
		setSize(700, 450);
		setResizable(false);
	    this.setLocationRelativeTo(null);
	    setModalityType(DEFAULT_MODALITY_TYPE);
		setDefaultCloseOperation(DISPOSE_ON_CLOSE);
		controlador = new ControlerAdministrador();		
		a=controlador.getListaEmpleados();	
		System.out.println(a.get(0));
		
		 listaEmpleados = new JList(a.toArray());
	     listaEmpleados.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);  		
	     listaEmpleados.setBounds(50, 50,600, 300);
	     add(listaEmpleados);
	
	}

}
